package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SetmealDishMapper {
    /**
     * 新增
     * @param setmealDishes
     */
    void insertBatch(List<SetmealDish> setmealDishes);

    /**
     * 删除套餐和菜品的关系
     * @param id
     */
    void deleteBySetmealId(Long id);

    /**
     * 根据setmeal id 查询菜品和套餐的关系表
     * @param id
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> getBySetmealId(Long id);

    /**
     * 根据setmeal id 查询菜品和套餐的关系表
     * @param ids
     */
    void deleteBySetmealIds(List<Long> ids);

    /**
     * 根据dish查询
     * @param id
     * @return
     */
    @Select("select * from setmeal_dish where dish_id = #{id}")
    List<SetmealDish> getByDishId(Long id);
}
